AWS Elastic Load Balancing Construct Library
The @aws-cdk/aws-ec2
package provides constructs for configuring
classic load balancers.
Configuring a Load Balancer
Load balancers send traffic to one or more AutoScalingGroups. Create a load
balancer, set up listeners and a health check, and supply the fleet(s) you want
to load balance to in the targets
property.
const lb = new elb.LoadBalancer(stack, 'LB', {
vpc,
internetFacing: true,
healthCheck: {
port: 80
},
});
lb.addTarget(myAutoScalingGroup);
lb.addListener({
externalPort: 80,
});
The load balancer allows all connections by default. If you want to change that,
pass the allowConnectionsFrom
property while setting up the listener:
lb.addListener({
externalPort: 80,
allowConnectionsFrom: [mySecurityGroup]
});
0.9.2 (2018-09-20)
NOTICE: This release includes a framework-wide breaking change which changes the type of all the string resource attributes across the framework. Instead of using strong-types that extend cdk.Token
(such as QueueArn
, TopicName
, etc), we now represent all these attributes as normal string
s, and codify the tokens into the string (using the feature introduced in #168).
Furthermore, the cdk.Arn
type has been removed. In order to format/parse ARNs, use the static methods on cdk.ArnUtils
.
See motivation and discussion in #695.
Breaking Changes
- cfn2ts: use stringified tokens for resource attributes instead of strong types (#712) (6508f78), closes #518 #695 #744
- aws-dynamodb: Attribute type for keys, changes the signature of the
addPartitionKey
and addSortKey
methods to be consistent across the board. (#720) (e6cc189) - aws-codebuild: fix typo "priviledged" -> "privileged
Bug Fixes
Features
- aws-apigateway: new API Gateway Construct Library (#665) (b0f3857)
- aws-cdk: detect presence of EC2 credentials (#724) (8e8c295), closes #702 #130
- aws-codepipeline: make the Stage insertion API in CodePipeline more flexible (#460) (d182818)
- aws-codepipeline: new "Pipeline#addStage" convenience method (#647) (25c9fa0)
- aws-rds: add support for parameter groups (#729) (2541508), closes #719
- docs: add documentation for CDK toolkit plugings (#733) (965b918)
- dependencies: upgrade to jsii 0.7.6